package struts.actionForm;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class ActionFormPersonneCode extends ActionForm {

	private int code;
	
	
	
	public int getCode() {
		return code;
	}



	public void setCode(int code) {
		this.code = code;
	}



	public ActionFormPersonneCode() {
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		// TODO Auto-generated method stub
		ActionErrors erreurs = new ActionErrors();
		if(this.code<1)
			erreurs.add("Erreur Code negatif", new ActionMessage("ActionFormPersonneCode.Erreur.Code.Negatif"));
		return erreurs;
	}

}
